package com.hsc.yalebao.newui;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.hsc.yalebao.tools.DateUtil;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;

public class UpNewIndexAdapter extends BaseAdapter
{
  private Context context;
  private List<Map<String, Object>> messageList;

  public UpNewIndexAdapter(List<Map<String, Object>> paramList, Context paramContext)
  {
    this.messageList = paramList;
    this.context = paramContext;
  }

  public int getCount()
  {
    if (this.messageList == null)
      return 0;
    return this.messageList.size();
  }

  public Object getItem(int paramInt)
  {
    return this.messageList.get(paramInt);
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    ViewHolder localViewHolder;
    if (paramView == null)
    {
      paramView = View.inflate(this.context, 2130903224, null);
      localViewHolder = new ViewHolder();
      localViewHolder.mQihaoTv = ((TextView)paramView.findViewById(2131100360));
      localViewHolder.mTimeTv = ((TextView)paramView.findViewById(2131100326));
      localViewHolder.mResultTv = ((TextView)paramView.findViewById(2131100361));
      localViewHolder.mResultTv2 = ((TextView)paramView.findViewById(2131100362));
      paramView.setTag(localViewHolder);
    }
    while (true)
    {
      Map localMap = (Map)this.messageList.get(paramInt);
      System.out.println(localMap.get("result"));
      JSONArray localJSONArray = (JSONArray)localMap.get("result");
      localViewHolder.mQihaoTv.setText(localMap.get("issue"));
      String str = DateUtil.getTimeStrFromLong(1000L * Long.valueOf(localMap.get("open_time")).longValue(), "MM-dd HH:mm");
      localViewHolder.mTimeTv.setText(str);
      try
      {
        localViewHolder.mResultTv2.setVisibility(0);
        localViewHolder.mResultTv.setText(localJSONArray.get(0) + "+" + localJSONArray.get(1) + "+" + localJSONArray.get(2) + "=");
        localViewHolder.mResultTv2.setText(localMap.get("conversion_result"));
        return paramView;
        localViewHolder = (ViewHolder)paramView.getTag();
      }
      catch (JSONException localJSONException)
      {
        while (true)
        {
          localViewHolder.mResultTv.setText("本期必看");
          localViewHolder.mResultTv2.setVisibility(8);
        }
      }
    }
  }

  public void setData(ArrayList<Map<String, Object>> paramArrayList)
  {
    this.messageList = paramArrayList;
  }

  class ViewHolder
  {
    public TextView mQihaoTv;
    public TextView mResultTv;
    public TextView mResultTv2;
    public TextView mTimeTv;

    ViewHolder()
    {
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.newui.UpNewIndexAdapter
 * JD-Core Version:    0.6.2
 */